#include "custom.h"
#include "ui_custom.h"

Custom::Custom(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Custom)
{
    this->resize(200,40);
    spin = new QSpinBox(this);
    slider = new QSlider(Qt::Horizontal,this);

    QHBoxLayout* layout = new QHBoxLayout;
    layout->addWidget(spin);
    layout->addWidget(slider);

    setLayout(layout);

    connect(spin,
            static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
            slider,&QSlider::setValue);
    connect(slider,&QSlider::valueChanged,
            spin,&QSpinBox::setValue);
}

Custom::~Custom()
{
    delete ui;
}
